const accessTokens: any = {
  admin: "admin",
  editor: "editor",
  test: "test",
};
export default [
  {
    url: "/api/login",
    type: "post",
    response(config: any) {
      const { username } = config.body;
      const accessToken = accessTokens[username] ?? "";
      if (!accessToken) {
        return {
          code: 500,
          message: "帐户或密码不正确。",
        };
      }
      return {
        code: 200,
        message: "success",
        data: {
          token:
            "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwZXJtaXNzaW9ucyI6ImFkbWluIiwiaXNzIjoic3RlcCIsIm5hbWUiOiLmsJHmlL_lsYDotKblj7ciLCJleHAiOjE2ODU1ODYwNjIsInVzZXJOYW1lIjoiMTg0MzI5NzQxNzkiLCJkZXBhcnRtZW50Ijoi5rCR5pS_5bGAIiwidXNlcklkIjoiMSJ9._R9rM79NpDQa5bGOqsXl-3kU9942Fglyi2ZP-o_3QPY",
          userId: 1,
          role: "admin",
          username: "jjj",
        },
      };
    },
  },
];
